/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.site.user.pojo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author zhanjun
 */
@Entity
@Table(name = "tb_resource")
@NamedQueries({
    @NamedQuery(name = "TbResource.findAll", query = "SELECT t FROM TbResource t"),
    @NamedQuery(name = "TbResource.findByIdResource", query = "SELECT t FROM TbResource t WHERE t.idResource = :idResource"),
    @NamedQuery(name = "TbResource.findByParentId", query = "SELECT t FROM TbResource t WHERE t.parentId = :parentId"),
    @NamedQuery(name = "TbResource.findByResName", query = "SELECT t FROM TbResource t WHERE t.resName = :resName"),
    @NamedQuery(name = "TbResource.findByResDesc", query = "SELECT t FROM TbResource t WHERE t.resDesc = :resDesc"),
    @NamedQuery(name = "TbResource.findByResType", query = "SELECT t FROM TbResource t WHERE t.resType = :resType"),
    @NamedQuery(name = "TbResource.findBySystemId", query = "SELECT t FROM TbResource t WHERE t.systemId = :systemId"),
    @NamedQuery(name = "TbResource.findByLevel", query = "SELECT t FROM TbResource t WHERE t.level = :level"),
    @NamedQuery(name = "TbResource.findByResource", query = "SELECT t FROM TbResource t WHERE t.resource = :resource"),
    @NamedQuery(name = "TbResource.findByOrderby", query = "SELECT t FROM TbResource t WHERE t.orderby = :orderby"),
    @NamedQuery(name = "TbResource.findBySign", query = "SELECT t FROM TbResource t WHERE t.sign = :sign")})
public class TbResource implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_RESOURCE")
    private String idResource;
    @Column(name = "PARENT_ID")
    private String parentId;
    @Column(name = "RES_NAME")
    private String resName;
    @Column(name = "RES_DESC")
    private String resDesc;
    @Column(name = "RES_TYPE")
    private String resType;
    @Column(name = "SYSTEM_ID")
    private String systemId;
    @Column(name = "LEVEL")
    private Integer level;
    @Column(name = "RESOURCE")
    private String resource;
    @Column(name = "ORDERBY")
    private Integer orderby;
    @Column(name = "SIGN")
    private String sign;

    public TbResource() {
    }

    public TbResource(String idResource) {
        this.idResource = idResource;
    }

    public String getIdResource() {
        return idResource;
    }

    public void setIdResource(String idResource) {
        this.idResource = idResource;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getResName() {
        return resName;
    }

    public void setResName(String resName) {
        this.resName = resName;
    }

    public String getResDesc() {
        return resDesc;
    }

    public void setResDesc(String resDesc) {
        this.resDesc = resDesc;
    }

    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType;
    }

    public String getSystemId() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public Integer getOrderby() {
        return orderby;
    }

    public void setOrderby(Integer orderby) {
        this.orderby = orderby;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idResource != null ? idResource.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbResource)) {
            return false;
        }
        TbResource other = (TbResource) object;
        if ((this.idResource == null && other.idResource != null) || (this.idResource != null && !this.idResource.equals(other.idResource))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.site.user.pojo.TbResource[idResource=" + idResource + "]";
    }

}
